package com.cms.manage.common;

import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
public class ConmonConfig {
	//通用map配置
	private static HashMap<String, Object> result = new HashMap<String, Object>(){{
		put("code",SysCode.success);
		put("message","完成！");
		put("data","");
	}};
	
	//文件上传相关参数
	private static String endpoint;//阿里云oss地址
	private static String bucketName;//已经在控制台创建的bucket名字
	private static String picLocation;//你上传文件的保存路径,不存在则创建
	private static String accessKeyId;//上传应用id
	private static String accessKeySecret;//上传秘钥
	private static String boyPhotoUrl;//男头像
	private static String girlPhotoUrl;//女头像
	private static String emailHost;// #邮箱服务器地址
	private static String emailName;// #邮件用户名
	private static String emailPassword;// 邮件用密码
	private static String emailPort;// #邮箱服务器端口
	private static String emailSend;// #邮箱发送人
	private static String siteDomain;//站点域名
	private static String key;//#校验秘钥
	private static String freeChar;//#升级黄钻赠送的免费字符
	private static String intPhoto;//添加照片时候的增加积分
	private static String intDelPhoto;//添加照片时候的增加负积分L
	private static String urlImgL;//图片地址
	private static String jwtKey;//加密盐
	private static String jpappKey;//极光推送账号
	private static String jpmasterSecret;//极光推送密码
	private static String fanyi_appid; //百度翻译appid
	private static String fanyi_key;//百度翻译key
	private static String fanyi_client_id;//百度翻译client_id
	private static String talkFileType;//聊天支持的发送文件格式
	private static String talkImgType;//聊天支持的发送图片格式
	private static String noRebateGoods;//不打折商品
	private static String indexHtml;//首页
	private static String hostIP;//服务器ip
	static {
		try {
			InputStream ins = ConmonConfig.class.getResourceAsStream("/config.properties");
			Properties p = new Properties();
			p.load(ins);			
			//文件上传参数
			endpoint=p.getProperty("endpoint");
			bucketName=p.getProperty("bucketName");
			picLocation=p.getProperty("picLocation");	
			accessKeyId=p.getProperty("accessKeyId");	
			accessKeySecret=p.getProperty("accessKeySecret");	
			boyPhotoUrl=p.getProperty("boyPhotoUrl");
			girlPhotoUrl=p.getProperty("girlPhotoUrl");
			emailHost=p.getProperty("emailHost");
			emailName=p.getProperty("emailName");
			emailPassword=p.getProperty("emailPassword");
			emailPort=p.getProperty("emailPort");
			emailSend=p.getProperty("emailSend");
			siteDomain=p.getProperty("siteDomain");
			key=p.getProperty("key");
			freeChar=p.getProperty("freeChar");
			intPhoto=p.getProperty("intPhoto");
			intDelPhoto=p.getProperty("intDelPhoto");
			urlImgL=p.getProperty("urlImgL");
			jwtKey=p.getProperty("jwtKey");
			jpappKey=p.getProperty("jpappKey");
			jpmasterSecret=p.getProperty("jpmasterSecret");
			fanyi_appid=p.getProperty("fanyi_appid");
			fanyi_key=p.getProperty("fanyi_key");
			fanyi_client_id=p.getProperty("fanyi_client_id");
			talkFileType=p.getProperty("talkFileType");
			talkImgType=p.getProperty("talkImgType");
			noRebateGoods=p.getProperty("noRebate");
			indexHtml=p.getProperty("indexHtml");
			hostIP=p.getProperty("hostIP");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public static String getJwtKey() {
		return jwtKey;
	}
	public static void setJwtKey(String jwtKey) {
		ConmonConfig.jwtKey = jwtKey;
	}
	public static String getEndpoint() {
		return endpoint;
	}
	public static void setEndpoint(String endpoint) {
		ConmonConfig.endpoint = endpoint;
	}
	public static String getPicLocation() {
		return 	picLocation;
	}
	public static void setPicLocation(String picLocation) {
		ConmonConfig.picLocation = picLocation;
	}
	public static String getAccessKeyId() {
		return accessKeyId;
	}
	public static void setAccessKeyId(String accessKeyId) {
		ConmonConfig.accessKeyId = accessKeyId;
	}
	public static String getAccessKeySecret() {
		return accessKeySecret;
	}
	public static void setAccessKeySecret(String accessKeySecret) {
		ConmonConfig.accessKeySecret = accessKeySecret;
	}
	public static String getBucketName() {
		return bucketName;
	}
	public static void setBucketName(String bucketName) {
		ConmonConfig.bucketName = bucketName;
	}
	public static String getBoyPhotoUrl() {
		return boyPhotoUrl;
	}
	public static void setBoyPhotoUrl(String boyPhotoUrl) {
		ConmonConfig.boyPhotoUrl = boyPhotoUrl;
	}
	public static String getGirlPhotoUrl() {
		return girlPhotoUrl;
	}
	public static void setGirlPhotoUrl(String girlPhotoUrl) {
		ConmonConfig.girlPhotoUrl = girlPhotoUrl;
	}
	public static String getEmailHost() {
		return emailHost;
	}
	public static void setEmailHost(String emailHost) {
		ConmonConfig.emailHost = emailHost;
	}
	public static String getEmailName() {
		return emailName;
	}
	public static void setEmailName(String emailName) {
		ConmonConfig.emailName = emailName;
	}
	public static String getEmailPassword() {
		return emailPassword;
	}
	public static void setEmailPassword(String emailPassword) {
		ConmonConfig.emailPassword = emailPassword;
	}
	public static String getEmailPort() {
		return emailPort;
	}
	public static void setEmailPort(String emailPort) {
		ConmonConfig.emailPort = emailPort;
	}
	public static String getEmailSend() {
		return emailSend;
	}
	public static void setEmailSend(String emailSend) {
		ConmonConfig.emailSend = emailSend;
	}
	public static String getSiteDomain() {
		return siteDomain;
	}
	public static void setSiteDomain(String siteDomain) {
		ConmonConfig.siteDomain = siteDomain;
	}
	public static String getKey() {
		return key;
	}
	public static void setKey(String key) {
		ConmonConfig.key = key;
	}
	public static String getFreeChar() {
		return freeChar;
	}
	public static void setFreeChar(String freeChar) {
		ConmonConfig.freeChar = freeChar;
	}
	public static String getIntPhoto() {
		return intPhoto;
	}
	public static void setIntPhoto(String intPhoto) {
		ConmonConfig.intPhoto = intPhoto;
	}
	public static String getIntDelPhoto() {
		return intDelPhoto;
	}
	public static void setIntDelPhoto(String intDelPhoto) {
		ConmonConfig.intDelPhoto = intDelPhoto;
	}
	public static String getUrlImgL() {
		return urlImgL;
	}
	public static void setUrlImgL(String urlImgL) {
		ConmonConfig.urlImgL = urlImgL;
	}
	public static String getJpappKey() {
		return jpappKey;
	}
	public static void setJpappKey(String jpappKey) {
		ConmonConfig.jpappKey = jpappKey;
	}
	public static String getJpmasterSecret() {
		return jpmasterSecret;
	}
	public static void setJpmasterSecret(String jpmasterSecret) {
		ConmonConfig.jpmasterSecret = jpmasterSecret;
	}
	public static String getFanyi_appid() {
		return fanyi_appid;
	}
	public static void setFanyi_appid(String fanyi_appid) {
		ConmonConfig.fanyi_appid = fanyi_appid;
	}
	public static String getFanyi_key() {
		return fanyi_key;
	}
	public static void setFanyi_key(String fanyi_key) {
		ConmonConfig.fanyi_key = fanyi_key;
	}
	public static String getFanyi_client_id() {
		return fanyi_client_id;
	}
	public static void setFanyi_client_id(String fanyi_client_id) {
		ConmonConfig.fanyi_client_id = fanyi_client_id;
	}
	public static String getTalkFileType() {
		return talkFileType;
	}
	public static void setTalkFileType(String talkFileType) {
		ConmonConfig.talkFileType = talkFileType;
	}
	public static String getTalkImgType() {
		return talkImgType;
	}
	public static void setTalkImgType(String talkImgType) {
		ConmonConfig.talkImgType = talkImgType;
	}
	public static String getNoRebateGoods() {
		return noRebateGoods;
	}
	public static void setNoRebateGoods(String noRebateGoods) {
		ConmonConfig.noRebateGoods = noRebateGoods;
	}
	public static HashMap<String, Object> getResultMap() {	
		HashMap<String, Object> map = (HashMap<String, Object>) result.clone();
		return map;
	}
	public static String getIndexHtml() {
		return indexHtml;
	}
	public static void setIndexHtml(String indexHtml) {
		ConmonConfig.indexHtml = indexHtml;
	}
	public static String getHostIP() {
		return hostIP;
	}
	public static void setHostIP(String hostIP) {
		ConmonConfig.hostIP = hostIP;
	}
}
